package com.logistics.modules.financialManagement.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.logistics.common.utils.PageUtils;
import com.logistics.common.utils.Query;

import com.logistics.modules.financialManagement.dao.FreightDao;
import com.logistics.modules.financialManagement.entity.FreightEntity;
import com.logistics.modules.financialManagement.service.FreightService;


@Service("freightService")
public class FreightServiceImpl extends ServiceImpl<FreightDao, FreightEntity> implements FreightService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<FreightEntity> page = this.page(
                new Query<FreightEntity>().getPage(params),
                new QueryWrapper<FreightEntity>()
        );

        return new PageUtils(page);
    }

    /**
     * 完成运费表
     *
     * @param movePlanId            行动计划id
     * @param theAmountActuallyPaid 实际支付金额
     */
    @Override
    public void completeTheShippingSchedule(Integer movePlanId, Double theAmountActuallyPaid) {
        this.baseMapper.updateOutOfPockeyExpensesByMovePlanId(theAmountActuallyPaid, movePlanId);
    }


}